pattern programming using while loops